package com.br.aiops.api;

import com.br.aiops.counter.AlertLogCounter;
import com.br.aiops.counter.Counter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 列出所有告警规则
 */
@RestController
@RequestMapping("/api/counter")
public class CounterController {

    @Autowired
    private Counter counter;

    @GetMapping
    public Map<String, AlertLogCounter> counters() {
        return counter.getCounter();
    }
}
